﻿@model LyyCMS.Core.Models.Blog

@{
    ViewData["Title"] = "Create";
}    

<h1>Create</h1>

<h4>Blog</h4>
<hr />
<div class="row">
    <div class="col-md-4">
        <form asp-action="Create">
            <div asp-validation-summary="ModelOnly" class="text-danger" runat="server" 
            DisplayMode="SingleParagraph" BackColor="Yellow" ></div>
            <div class="form-group">
                <label asp-for="Title" class="control-label"></label>
                <input asp-for="Title" class="form-control" />
                <span asp-validation-for="Title" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Content" class="control-label"></label>
                <input multiple asp-for="Content" class="form-group" />
               
                <span asp-validation-for="Content" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Create_At" class="control-label"></label>
                <input asp-for="Create_At" class="form-control" />
                <span asp-validation-for="Create_At" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Category" class="control-label"></label>
                @Html.DropDownList("Category", new SelectList(ViewBag.BlogCategory), new { @class = "btn btn-success dropdown-toggle form-control" })


                @*这种方式也可以*@
                @*<select asp-items="@Html.GetEnumSelectList(typeof(LyyCMS.Core.Models.BlogCategory))" class="btn btn-success dropdown-toggle form-control"></select>*@

                @*<select asp-for="Category" class="form-control"></select>*@
                <span asp-validation-for="Category" class="text-danger"></span>
            </div>
            <div class="form-group">
                <input type="submit" value="Create" class="btn btn-primary" />
            </div>
        </form>
    </div>
</div>

<div>
    <a asp-action="Index">Back to List</a>
</div>


@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
 